﻿function setRight(id)
{
    var hid = document.getElementById("hidRightID");
    var chk = event.srcElement;
    if (chk.checked)
    {
        if (hid.value == "")
        {
            hid.value = ",";
        }

        hid.value += id + ",";
    }
    else
    {
        hid.value = hid.value.replace("," + id + ",", ",");
        if (hid.value == ",")
        {
            hid.value = "";
        }
    }
}

function InitSelect(ids)
{
    var arrIDs = ids.split(",");
    for (var i in arrIDs)
    {
        if (arrIDs[i] != "")
        {
            var chk = document.getElementById("_" + arrIDs[i]);
            if (chk != null)
            {
                chk.click();
            }
        }
    }
}

function DisableSelectNode(ids)
{
    var arrIDs = ids.split(",");
    for (var i in arrIDs)
    {
        if (arrIDs[i] != "")
        {
            var chk = document.getElementById("_" + arrIDs[i]);
            chk.checked = true;
            chk.disabled = true;
        }
    }
}